package com.ly.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ly.system.system.bean.entity.SysTenant;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 租户-mapper
 *
 * @author jeecg
 */
public interface SysTenantMapper extends BaseMapper<SysTenant> {

    /**
     * 获取最大值id
     */
    @Select("select MAX(id) id FROM sys_tenant")
    Integer getMaxTenantId();

    /**
     * 获取租户回收站的数据假删除
     *
     * @param page
     * @param sysTenant
     * @return
     */
    List<SysTenant> getRecyclePage(@Param("page") Page<SysTenant> page, @Param("sysTenant") SysTenant sysTenant);

    /**
     * 租户还原
     *
     * @param ids
     * @return
     */
    Integer deleteLogicTenant(@Param("ids") List<String> ids);

    /**
     * 租户还原
     *
     * @param ids
     * @return
     */
    Integer revertLogicTenant(@Param("ids") List<String> ids);
}
